$(function() {
	var tip = '${ftpServerInfo.ftpDirectory}';
	$("#ftpDownloadPath").attr('placeholder',$("#ftpPathPlaceholder").val());
	$("#ftpPath").attr('placeholder',$("#ftpPathPlaceholder").val());
	$("#ftpDirectory").attr("placeholder",$("#ftpPathPlaceholder").val());
	$("#ftpDownloadDirectory").attr("placeholder",$("#ftpPathPlaceholder").val());
	$("#localFilPath").attr("placeholder",$("#localFilPathPlaceholder").val());
	$("#localFileDirectory").attr("placeholder",$("#localFilPathPlaceholder").val());
});

function downloadFtpFileAndUploadByFtpPath(){
	$.ajax({
		type : 'POST',
		data : {
			"ftpPath" : $('#ftpDownloadPath').val()
		},
		url : '/sftp/downloadFtpFileAndUploadByFtpPath',
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
			} else {
				layer.msg(r.msg);
			}
		}
	}); 
}

function downloadFtpFileAndUploadByFtpDirectory(){
	$.ajax({
		type : 'POST',
		data : {
			"ftpDirectory" : $('#ftpDownloadDirectory').val()
		},
		url : '/sftp/downloadFtpFileAndUploadByFtpDirectory',
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
			} else {
				layer.msg(r.msg);
			}
		}
	}); 
}

function downloanByFtpPath(){
	$.ajax({
		type : 'POST',
		data : {
			"ftpPath" : $('#ftpPath').val()
		},
		url : '/transport/downloadFtpFileByFtpPath',
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
			} else {
				layer.msg(r.msg);
			}
		}
	}); 
}


function downloanByFtpDirectory(){
	$.ajax({
		type : 'POST',
		data : {
			"ftpDirectory" : $('#ftpDirectory').val()
		},
		url : '/transport/downloadFtpFileByFtpDirectory',
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
			} else {
				layer.msg(r.msg);
			}
		}
	}); 
}

function uploadFile(){
	$.ajax({
		type : 'POST',
		data : {
			"localFilPath" : $('#localFilPath').val()
		},
		url : '/transport/uploadFile',
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
			} else {
				layer.msg(r.msg);
			}
		}
	}); 
}

function uploadFileByLocalDirectory(){
	$.ajax({
		type : 'POST',
		data : {
			"localFileDirectory" : $('#localFileDirectory').val()
		},
		url : '/transport/uploadFileByLocalDirectory',
		success : function(r) {
			if (r.code == 0) {
				layer.msg(r.msg);
			} else {
				layer.msg(r.msg);
			}
		}
	}); 
}
